#pragma once
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <QMatrix4x4>
#include <QOpenGLTexture>
#include <QOpenGLVertexArrayObject>
#include <QSequentialAnimationGroup>
#include <QPropertyAnimation>
#include <QOpenGLExtraFunctions>
#include "core/RectangleShape.h"
#include "Scene.h"
class Render {
public:
	Render();
	~Render();
	void init();
	void initTextureProgram();
	void initProgram();
	void resize(int w, int h) {
		this->width = w;
		this->height = h;
		this->derty = true;
	}
	void render();

	Scene* getScene() {
		return this->scene;
	}
private:
	QOpenGLShaderProgram* program = new QOpenGLShaderProgram;
	QOpenGLShaderProgram* textureProgram = new QOpenGLShaderProgram;

	QOpenGLVertexArrayObject* vao = nullptr;
	QOpenGLVertexArrayObject* textureVao = nullptr;

	int modelLocation = 0;
	int cameraLocation = 0;
	int colorLocation = 0;
	int textureModelLocation = 0;
	int textureCameraLocation = 0;
	float width;
	float height;
	bool derty = true;
	Scene* scene = new Scene();
};